package org.mines.douai.j2ee.cxf;

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

public class HelloWorldConsumer {
	public static void main(String[] args) {
		JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
		factory.getInInterceptors().add(new LoggingInInterceptor());
		factory.getOutFaultInterceptors().add(new LoggingOutInterceptor());
		factory.setServiceClass(HelloWorld.class);
		//factory.setAddress("http://localhost:8080/TpWebService/services/HelloWorldImplPort");
		factory.setAddress("http://localhost:54218/WCFService1/Service.svc");
		HelloWorld client = (HelloWorld) factory.create();

		String reply = client.sayHi("ifbfqibfqi");
		System.out.println("Server said: " + reply);
		System.exit(0);

	}

}


